/*
 * Teacher.cpp
 *
 *  Created on: 13 May 2010
 *      Author: Savramis Sartios
 */

#include "Teacher.h"


Teacher::Teacher(const string *code,const string *name,const string *lastName){
	if((NULL!=code)&&(NULL!=name)&&(NULL!=lastName)){
		setCode(code);
		setName(name);
		setLastName(lastName);
	}
}
Teacher::Teacher() {
	code_=NULL;
	lastName_=NULL;
	name_=NULL;

}

Teacher::Teacher(const ITeacher *teacher){
	if(NULL!=teacher){
		const string CODE = *teacher->getCode();
		const string NAME = *teacher->getName();
		const string LASTNAME = *teacher->getLastName();

		setCode(&CODE);
		setName(&NAME);
		setLastName(&LASTNAME);

	}
}

Teacher::~Teacher() {
	delete name_;
	delete code_;
	delete lastName_;
}

void	Teacher::setName(const string *name){
	if(0!=name){
		name_ = new string(*name);
	}
}

string	*	Teacher::getName()const{
		return name_;
}

void		Teacher::setLastName(const string *lastName){
	if(NULL!=lastName){
		lastName_= new string(*lastName);
	}
}

string	*	Teacher::getLastName()const{
	if(NULL!=lastName_){
		return lastName_;
	}
	return NULL;
}

void	Teacher::setCode(const string *code){
	if(NULL!=code){
		code_=new string(*code);
	}
}

string	*	Teacher::getCode()const{
		return code_;
}
